import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App'
import router from './router'
import store from './store'
import _ from 'lodash'
import {post,get} from './utils/AxiosPlugin'
// import {getCookie,setCookie,delCookie} from '@/common/js/cookie'


// import $ from 'jquery'
// import './common/js/ztreeJs/jquery.ztree.core'
// import  './common/js/ztreeJs/jquery.ztree.excheck'
// import  './common/js/ztreeJs/jquery.ztree.exedit'

// Vue.prototype.$getCookie = getCookie;
// Vue.prototype.$setCookie = setCookie;
// Vue.prototype.$delCookie = delCookie;
// Vue.prototype.$get = get;
Vue.prototype.$post = post;
Vue.prototype.$get = get;
Vue.use(_);

Vue.prototype.routerTabs = {
    selected: 'home',
    list: [{
        name: '首页',
        path: '/home'
    }, {
        name: '日程',
        path: '/oa/agenda/agenda'
    }, {
        name: '任务',
        path: '/oa/agenda/mission'
    }]
}

//设置cookie
//Vue.prototype.setCookie = (c_name, value, expiredays) => {
//   var exdate = new Date();　　　　
//   exdate.setDate(exdate.getDate() + expiredays);　　　　
//   document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
// }
// //获取cookie、
// function getCookie(name) {
//   var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
//   if (arr = document.cookie.match(reg))
//     return (arr[2]);
//   else
//     return null;
// }
// Vue.prototype.getCookie = getCookie;
// //删除cookie
// Vue.prototype.delCookie =(name) => {
//     var exp = new Date();
//     exp.setTime(exp.getTime() - 1);
//     var cval = getCookie(name);
//     if (cval != null)
//       document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
//   }

Vue.use(ElementUI)
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: { App }
})
